home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap10 / EZPrint / EZPrint.cpp next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  896 b   |  39 lines

  1. //***********************************************************************
  2. //
  3. //  EZPrint.cpp
  4. //
  5. //***********************************************************************
  6.  
  7. #include <afxwin.h>
  8. #include "Resource.h"
  9. #include "EZPrint.h"
  10. #include "EZPrintDoc.h"
  11. #include "EZPrintView.h"
  12.  
  13. CPrintApp myApp;
  14.  
  15. BEGIN_MESSAGE_MAP (CPrintApp, CWinApp)
  16.     ON_COMMAND (ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  17. END_MESSAGE_MAP ()
  18.  
  19. BOOL CPrintApp::InitInstance ()
  20. {
  21.     CSingleDocTemplate* pDocTemplate;
  22.     pDocTemplate = new CSingleDocTemplate (
  23.         IDR_MAINFRAME,
  24.         RUNTIME_CLASS (CPrintDoc),
  25.         RUNTIME_CLASS (CFrameWnd),
  26.         RUNTIME_CLASS (CPrintView)
  27.     );
  28.  
  29.     AddDocTemplate (pDocTemplate);
  30.  
  31.     CCommandLineInfo cmdInfo;
  32.     ParseCommandLine (cmdInfo);
  33.  
  34.     if (!ProcessShellCommand (cmdInfo))
  35.         return FALSE;
  36.  
  37.     return TRUE;
  38. }
  39.